This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jan 15, 2013, 7:21 AM
12 Posts

Problem displaying data in a Panel

  • Category: Other
  • Platform: All
  • Release: 8.5.1
  • Role: Developer
  • Tags: Panel,Document Data Source
  • Replies: 3
Hello,
 
I have a repeat control on a xpage, the repeat control is bound to a view and displays the first column of the view. When the link is clicked, I am setting a viewScope with the universalID.
 
<xp:panel>
        <xp:repeat id="repeat1" rows="30"
            value="#{items2}" var="rowData">
            <xp:link escape="true" id="link1">
                <xp:this.text><![CDATA[#{javascript:rowData.getColumnValues()[0]}]]></xp:this.text>
                <xp:eventHandler event="onclick" submit="true"
                    refreshMode="partial" refreshId="outerPanle">
                    <xp:this.action><![CDATA[#{javascript:viewScope.put("UNID",rowData.getUniversalID())}]]></xp:this.action>
                </xp:eventHandler></xp:link><br></br>
        </xp:repeat>
    </xp:panel>
 
 
I then created a panel with the a data source as a document and document ID as the UniversalID (viewScope). Added fields from the data source, when launched on the browser, I could see the UniversalID for each document I click, however, I could not see any data in the fields. Not sure what I am missing.
 
The Intention is to see the view and document on the same xpage. Are there are any other Ideas to achieve this?
 
Any Ideas / suggestions are greatly appreciated,
 
Thanks,
Ven
 
 
Jan 15, 2013, 3:21 PM
366 Posts
Re: Problem displaying data in a Panel
 Are you doing a partial refresh or a complete refresh in the repeat controls onClick event?  Make sure you are targeting the panel that has the document datasource associated to it.
 
Here is the source of a working example of this. 
 

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp="http://www.ibm.com/xsp/core"

styleClass="PageMargin" style="font-size:16pt">

<xp:this.data>

<xp:dominoView var="personView" viewName="PersonView" />

<xp:dominoDocument var="document1" formName="PersonForm"

documentId="#{javascript:sessionScope.docUNID;}"

action="openDocument">

</xp:dominoDocument>

</xp:this.data>


<xp:table styleClass="PageMargin" style="margin-left:25px;margin-top:25px;font-size:16pt">

<xp:tr style="font-size:16pt">

<xp:td valign="top" style="width:225px;font-size:16pt">

<xp:dataTable rows="30" id="dataTable1"

value="#{personView}" var="colName1" style="font-size:16pt">

<xp:this.facets>

<xp:pager partialRefresh="true"

layout="Previous Group Next" xp:key="header" id="pager1" style="font-size:16pt">

</xp:pager>

</xp:this.facets>


<xp:column id="column1" style="font-size:16pt">

<xp:link escape="true" id="link1" style="font-size:16pt">

<xp:this.text><![CDATA[#{javascript:var fn:String = colName1.getDocument().getItemValueString("FirstName");

var ln:String = colName1.getDocument().getItemValueString("LastName");

return fn + " " + ln;}]]></xp:this.text>

<xp:eventHandler event="onclick"

submit="true" refreshMode="partial" refreshId="PersonData"

id="eventHandler1">

<xp:this.action><![CDATA[#{javascript:sessionScope.docUNID = colName1.getDocument().getUniversalID();}]]></xp:this.action>

</xp:eventHandler>

</xp:link>

</xp:column>

</xp:dataTable>

</xp:td>

<xp:td style="font-size:16pt">&#160;</xp:td>

<xp:td styleClass="PageMargin" style="font-size:16pt">

<xp:panel id="PersonData" style="font-size:16pt">

<xp:table

rendered="#{javascript:sessionScope.docUNID!=null;}" style="font-size:16pt">

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="First name:"

id="firstName_Label1" for="firstName1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:inputText

value="#{document1.FirstName}" id="firstName1" style="font-size:16pt">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="Middle init:"

id="middleInit_Label1" for="middleInit1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:inputText

value="#{document1.MiddleInit}" id="middleInit1" style="font-size:16pt">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="Last name:"

id="lastName_Label1" for="lastName1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:inputText

value="#{document1.LastName}" id="lastName1" style="font-size:16pt">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="Full name:"

id="fullName_Label2" for="fullName1" style="font-size:16pt">

</xp:label></xp:td>

<xp:td style="font-size:16pt">


<xp:inputText value="#{document1.FullName}"

id="fullName1" style="font-size:16pt">

</xp:inputText></xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="Bday:" id="bday_Label1"

for="bday1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:inputText value="#{document1.Bday}"

id="bday1" style="font-size:16pt">

<xp:dateTimeHelper

id="dateTimeHelper1">

</xp:dateTimeHelper>

<xp:this.converter>

<xp:convertDateTime type="both"

dateStyle="short" timeStyle="short">

</xp:convertDateTime>

</xp:this.converter>

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="Email address:"

id="emailAddress_Label1" for="emailAddress1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:inputText

value="#{document1.EmailAddress}" id="emailAddress1" style="font-size:16pt">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="Phone number:"

id="phoneNumber_Label1" for="phoneNumber1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:inputText

value="#{document1.PhoneNumber}" id="phoneNumber1" style="font-size:16pt">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="City:" id="city_Label1"

for="city1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:inputText value="#{document1.City}"

id="city1" style="font-size:16pt">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="State:"

id="state_Label1" for="state1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:inputText value="#{document1.State}"

id="state1" style="font-size:16pt">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="Postal code:"

id="postalCode_Label1" for="postalCode1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:inputText

value="#{document1.PostalCode}" id="postalCode1" style="font-size:16pt">

</xp:inputText>

</xp:td>

</xp:tr>

<xp:tr style="font-size:16pt">

<xp:td style="font-size:16pt">

<xp:label value="Hobbies:"

id="hobbies_Label1" for="hobbies1" style="font-size:16pt">

</xp:label>

</xp:td>

<xp:td style="font-size:16pt">

<xp:repeat id="repeat1" rows="30" value="#{document1.Hobbies}" var="HobbyList" style="font-size:16pt">

<xp:text escape="false" id="computedField2" style="font-size:16pt">

<xp:this.value><![CDATA[#{javascript:HobbyList + "<br />"}]]></xp:this.value>

</xp:text>

</xp:repeat>

</xp:td>

</xp:tr>

</xp:table>

</xp:panel>

</xp:td>

</xp:tr>

</xp:table>

</xp:view> 
Jan 15, 2013, 4:47 PM
12 Posts
Re: Problem displaying data in a Panel
Thanks Paul for the code,
 
yes, I a doing a Partial Refresh in the Repeat Controls OnClick event, the  ID to refresh is set to a panel (outerPanel) that contains another panel (innerPanel) which contains the document datasource. I still could not get to display the data.
 
I believe, I am doing exactly the same thing except I am using a Repeat control in place of a DataTable. Do you think that could cause problems?. Other than that, I have the Form Property for the document DataSource "On Web Access-->Display Xpage Instead", I tried removing this property and still did not work.
 
Here is the source for the document Data, Repeat control and the Panels.
 
 
 Document DataSource:
 
<xp:dominoDocument var="document1" formName="Items"
            documentId="#{javascript:sessionScope.docUNID}"
            action="openDocument">
        </xp:dominoDocument>
 
View DataSource:
 <xp:dominoView var="items2" viewName="Items">
            <xp:this.categoryFilter><![CDATA[#{javascript:viewScope.get("OrdNum")}]]></xp:this.categoryFilter>
        </xp:dominoView>
 
 
 Source of the Repeat Control:
 
<xp:panel>
        <xp:repeat id="repeat1" rows="30" value="#{items2}" var="rowData">
            <xp:link escape="true" id="link1">
                <xp:this.text><![CDATA[#{javascript:rowData.getColumnValues()[0]}]]></xp:this.text>
                <xp:eventHandler event="onclick" submit="true"
                    refreshMode="partial" refreshId="outerPanle" id="eventHandler10">
                    <xp:this.action><![CDATA[#{javascript:sessionScope.docUNID = rowData.getDocument().getUniversalID();}]]></xp:this.action>
                </xp:eventHandler>
            </xp:link>
            <br></br>
        </xp:repeat>
    </xp:panel>
 
 
Source of the Panel.
<xp:panel id="outerPanle">
        <xp:panel id="innerPanel" rendered="#{javascript:sessionScope.docUNID!=null;}">
            Document           
            <xp:br></xp:br>
            <xp:text escape="true" id="computedField3">
                <xp:this.value><![CDATA[#{javascript:sessionScope.get("docUNID")}]]></xp:this.value> // I could see the docUnid change for each link I click
            </xp:text>
            <xp:br></xp:br>        
           
            <xp:br></xp:br>
            <xp:br></xp:br>
            
            <xp:table>
                <xp:tr>
                    <xp:td>
                        <xp:label value="Order num:"
                            id="orderNum_Label1" for="orderNum1">
                        </xp:label>
                    </xp:td>
                    <xp:td>
                        <xp:inputText value="#{document1.OrderNum}"
                            id="orderNum1">
                        </xp:inputText>
                    </xp:td>
                </xp:tr>
                <xp:tr>
                    <xp:td>
                        <xp:label value="S k u:" id="sKU_Label1"
                            for="sKU1">
                        </xp:label>
                    </xp:td>
                    <xp:td>
                        <xp:inputText value="#{document1.SKU}"
                            id="sKU1">
                        </xp:inputText>
                    </xp:td>
                </xp:tr>
            </xp:table></xp:panel>
    </xp:panel>
Jan 16, 2013, 6:50 AM
12 Posts
Re: Problem displaying data in a Panel
The functionality works fine if the xpage is launched by itself, if the xpage that contains the DataTable and Panel was launched from another xpage (link on a view control), the data in the panel does not showup.
 
For example, if Xpage A contains a view panel and one of the column is set to open the associated data in another xpage (Xpage B). The Xpage B has fields from the Document Data Source, a Data Table and a Panel that contains another Document Data Source.
 
If the Xpage B was launched directly (a web preview) the Split Screen functionality works fine. But, when launched from the XpageA, the data that is supposed to get displayed does not sow up.
 
I am not sure what is wrong or why it's not working. Any Ideas / suggestions?
 
Thanks,
Ven

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal